<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>verify_messages_received (Spec::Mocks::MessageExpectation)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/mocks/message_expectation.rb, line 140</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_messages_received</span>        
        <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@expected_received_count</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:any</span>
        <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@at_least</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@received_count</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@expected_received_count</span>)
        <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@at_most</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@received_count</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-ivar">@expected_received_count</span>)
        <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@expected_received_count</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@received_count</span>
    
        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">raise_expectation_error</span>(<span class="ruby-ivar">@sym</span>, <span class="ruby-ivar">@expected_received_count</span>, <span class="ruby-ivar">@received_count</span>, <span class="ruby-operator">*</span><span class="ruby-ivar">@args_expectation</span>.<span class="ruby-identifier">args</span>)
        <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>
          <span class="ruby-identifier">error</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@expected_from</span>)
          <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">raise</span> <span class="ruby-identifier">error</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>